import request from '@/config/axios'

// ERP基础资料-仓库资料 VO
export interface BaseWarehouseVO {
  id: string // id
  parentId: string // 父id
  warehouseNumber: string // 仓库编号
  warehouseName: string // 仓库名称
  warehouseType: string // 仓库类型
  warehouseManager: string // 仓库管理员
  defaultWarehouse: string // 默认仓库
  maxStockQuantity: string // 最大库存
  maxStockPackageQuantity: string // 最大库存包数
  defaultReturnWarehouse: string // 退货默认仓库
}

// ERP基础资料-仓库资料 API
export const BaseWarehouseApi = {
  // 查询ERP基础资料-仓库资料列表
  getBaseWarehouseList: async (params) => {
    return await request.get({ url: `/erp/base-warehouse/list`, params })
  },

  // 查询ERP基础资料-仓库资料详情
  getBaseWarehouse: async (id: number) => {
    return await request.get({ url: `/erp/base-warehouse/get?id=` + id })
  },

  // 新增ERP基础资料-仓库资料
  createBaseWarehouse: async (data: BaseWarehouseVO) => {
    return await request.post({ url: `/erp/base-warehouse/create`, data })
  },

  // 修改ERP基础资料-仓库资料
  updateBaseWarehouse: async (data: BaseWarehouseVO) => {
    return await request.put({ url: `/erp/base-warehouse/update`, data })
  },

  // 删除ERP基础资料-仓库资料
  deleteBaseWarehouse: async (id: number) => {
    return await request.delete({ url: `/erp/base-warehouse/delete?id=` + id })
  },

  // 导出ERP基础资料-仓库资料 Excel
  exportBaseWarehouse: async (params) => {
    return await request.download({ url: `/erp/base-warehouse/export-excel`, params })
  }
}
